#pragma once

#include "CoreCommon.h"

LOCO_BEGIN

// Useful mathematical const
#define PI 					(3.1415926535897932f)
#define INV_PI				(0.31830988618f)
#define HALF_PI				(1.57079632679f)
#define SMALL_NUMBER		(1.e-8f)
#define KINDA_SMALL_NUMBER	(1.e-4f)
#define EULERS_NUMBER       (2.71828182845904523536f)
#define RAD_TO_DEG			(57.29577951308232f)
#define DEG_TO_RAD			(0.017453292519943f)
// Magic numbers for numerical precision
#define DELTA				(0.00001f)

// Common maths functions
/*
inline float cos(float in) { return std::cos(in); }
inline float sin(float in) { return std::sin(in); }
inline float tan(float in) { return std::tan(in); }
inline float acos(float in) { return std::acos(in); }
inline float asin(float in) { return std::asin(in); }
inline float atan(float in) { return std::atan(in); }
inline float atan2(float y, float x) { return std::atan2(y, x); }
inline float exp(float in) { return std::exp(in); }
inline float log(float in) { return std::log(in); }
inline float sqrt(float in) { return std::sqrt(in); }
inline float pow(float in, float a_fPower) { return std::pow(in, a_fPower); }
inline float abs(float in) { return std::abs(in); }
inline float floor(float in) { return std::floor(in); }
inline float ceil(float in) { return std::ceil(in); }
inline float fmod(float numer, float denom) { return std::fmod(numer, denom); }
*/
inline float lerp(float a, float b, float value) { return a + value*(b - a); }
inline float clamp(float in, float min, float max) { return (in < min ? min : (in > max ? max : in)); }
inline bool  near_equal(float a, float b, float delta = DELTA) { return (abs(a - b) > delta ? false : true); }


LOCO_END
